import { http } from '@/utils/http/axios';

export interface PersonInfo {
  id?: number;
  name: string;
  sex: number;
  idCard: string;
  phone: string;
  nation: string;
  nativePlace: string;
  address: string;
  professionalAdditions: string;
}
export interface CertificateInfo {
  type: string;
  issueTime: string | undefined;
  name: string;
  certificateNumber: string;
  userId: number;
}

/**
 * @description: 获取人员列表
 */
export function getPersonList(params) {
  return http.request({
    url: '/project/peopleManagement',
    method: 'get',
    params,
  });
}
/**
 * @description: 获取用户列表
 */
export function getAllPerson(params) {
  return http.request({
    url: '/sys/user/allUser',
    method: 'get',
    params,
  });
}
/**
 * @description: 获取用户信息
 */
export function getPersonInfo(params) {
  return http.request({
    url: '/project/peopleManagement/info',
    method: 'get',
    params,
  });
}
/**
 * @description: 删除用户
 */
export function deletePerson(params) {
  return http.request({
    url: '/project/peopleManagement',
    method: 'DELETE',
    params,
  });
}
/**
 * @description: 用户新增
 */
export function createPerson(data) {
  return http.request({
    url: '/project/peopleManagement',
    method: 'POST',
    data,
  });
}
/**
 * @description: 用户修改
 */
export function updatePerson(data) {
  return http.request({
    url: '/project/peopleManagement',
    method: 'PUT',
    data,
  });
}
/**
 * @description: 获取证书列表
 */
export function getCertificateList(params) {
  return http.request({
    url: '/sys/cer',
    method: 'get',
    params,
  });
}
/**
 * @description: 获取证书信息
 */
export function getCertificateInfo(params) {
  return http.request({
    url: '/sys/cer/info',
    method: 'get',
    params,
  });
}
/**
 * @description: 删除证书
 */
export function deleteCertificate(params) {
  return http.request({
    url: '/sys/cer',
    method: 'DELETE',
    params,
  });
}
/**
 * @description: 证书新增
 */
export function createCertificate(data) {
  return http.request({
    url: '/sys/cer',
    method: 'POST',
    data,
  });
}
/**
 * @description: 证书修改
 */
export function updateCertificate(data) {
  return http.request({
    url: '/sys/cer',
    method: 'PUT',
    data,
  });
}
